package com.xbongbong.saas.model.impl;

import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.saas.domain.dao.PromotionProductDao;
import com.xbongbong.saas.domain.entity.PromotionProductEntity;
import com.xbongbong.saas.model.PromotionProductModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

;

/**
 * @author bomfish
 */
@Service("promotionProductModel")
public class PromotionProductModelImpl implements PromotionProductModel {
    @Resource
    private PromotionProductDao promotionProductDao;

    @Override
    public Long insert(PromotionProductEntity entity) {
        return promotionProductDao.insert(entity);
    }

    @Override
    public void insertBatch(List<PromotionProductEntity> list) {
        promotionProductDao.insertBatch(list);
    }

    @Override
    public List<PromotionProductEntity> findEntities(Map<String, Object> param) {
        return promotionProductDao.findEntities(param);
    }

    @Override
    public Integer getEntityCount(Map<String, Object> param) {
        return promotionProductDao.getEntitiesCount(param);
    }

    @Override
    public void update(PromotionProductEntity entity) {
        promotionProductDao.update(entity);
    }

    @Override
    public PromotionProductEntity getByKey(Long key, String corpid) {
        return promotionProductDao.getByKey(key, corpid);
    }

    @Override
    public Integer deleteByRefId(Long refId, String corpid) {
        return promotionProductDao.deleteByRefId(refId, corpid);
    }

    @Override
    public List<PromotionProductEntity> getProductsByRefId(Long refId, String corpid) {
        return promotionProductDao.getProductsByRefId(refId, corpid);
    }

    @Override
    public Integer updateCategorybyProductId(Long categoryId, Long productId, String corpid) {
        return promotionProductDao.updateCategorybyProductId(categoryId, productId, corpid);
    }

}
